package com.weharvest.edu.service;

import com.weharvest.edu.dto.BackstageUserDTO;
import com.weharvest.edu.entity.BackstageUser;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;
import java.util.Optional;

public interface BackstageUserService {
    /**
     * 根据id查询是否后台用户
     *
     * @param id
     * @return
     */
    public Optional<BackstageUser> findByBackstageId(String id);

    /**
     * 根据openid查询是否后台用户
     *
     * @param backstageUserDTO
     * @return
     */
    public BackstageUser findByBackstageOpenid(BackstageUserDTO backstageUserDTO);

    /**
     * 分页查询后台用户列表
     *
     * @return
     */
    public Map<String, Object> find(
            BackstageUserDTO backstageUserDTO,
            HttpServletRequest request,
            HttpServletResponse response);

//    /**
//     * 新增后台用户
//     * @param backstageUserDTO
//     * @return
//     */
//    public BackstageUserView add(BackstageUserDTO backstageUserDTO);

    /**
     * 删除
     *
     * @param
     * @return
     */
    public void detele(BackstageUserDTO dto,
                       HttpServletRequest request,
                       HttpServletResponse response);

    /**
     * 新增
     *
     * @param dto
     * @return
     */
    public void add(BackstageUserDTO dto, HttpServletRequest request, HttpServletResponse response);


    /**
     * 修改
     *
     * @param dto
     * @param request
     * @param response
     * @return
     */
    public void modify(BackstageUserDTO dto,
                       HttpServletRequest request,
                       HttpServletResponse response);
}
